<?php
session_start();
include('includes/db/sql.functions.php');
ob_start();
$query=get_all_genes();
$hwsname=$_REQUEST[hwsname];

$genes = array();
foreach($query as $q){
	$genes = $q;
}
?>
<p>Do you want to add any existing gene from the database? Check and send whichever you want.</p>
<form id="GenList" onsubmit="return true" action="genlistVal.php" method="post">
<input type="hidden" name="hws_name" value="<?php echo $hwsname; ?>">
<?php
foreach($genes as $val){
	echo "<input type='checkbox' name='".$val[g_name]."' id='".$val[g_name]."'>$val[g_name]</input> \t \t";
}

?>
<button type="submit" id="checkbutton"> Add selected gen </button>
</form>

<p>The one you need doesn't exist? Don't worry, you can <a href="newGen.php?hwsname=<?php echo $hwsname;?>">add it here</a>.</p>

<script>

</script>

<?php
//TODO: Hacer un metodo que mande los nombres de los genes que estan marcados por  ajax a una pagina nueva que simplemente los meta en BD.
$content= ob_get_contents();
ob_end_clean();
include_once('template.php');

?>